package dang.action.main;

import dang.action.DangAction;
import dang.common.Constant;
import dang.dao.DaoFactory;
import dang.entity.Product;
import dang.exception.DangException;

public class ProductAction extends DangAction {
	private Product product;
	private int id;
	public String execute() {
		try {
			product=DaoFactory.getProductDao(Constant.TYPE_BOOK).findById(id);
			return "success";
		} catch (DangException e) {
			e.printStackTrace();
			return "error";
		}
	}
	
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
}
